package com.netease.main;

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

import com.netease.entity.impl.User;
import com.netease.operator.Operator;

public class Main {
	private static List<User> users = new ArrayList<User>();
	
	private static void initial() {
		users.add(new User(0, "name0", 15));
		users.add(new User(1, "name1", 16));
		users.add(new User(2, "name2", 17));
	}
	
	public static void main(String[] args) {
		initial();
		
		ClassPathResource resource = new ClassPathResource("spring.xml");
		XmlBeanFactory beanFactory = new XmlBeanFactory(resource);
		Operator o = (Operator) beanFactory.getBean("interceptorService");
		o.add(users.get(0));
		o.add(users.get(1));
		o.add(users.get(2));
		
		System.out.println(o.getNameById(0));
		System.out.println(o.getNameById(1));
	}
	
}
